<script type="text/javascript">
	function save() {
		$("#confirm").val("");
		$("#confirm_wrap  span.address_list span").each(function() {
			$("#confirm").val($("#confirm").val() + $(this).attr("data") + '|');
		})

		$("#confirm_name").val("");
		$("#confirm_name").val($("#confirm_wrap span.address_list").html());

		$("#consult").val("");
		$("#consult_wrap span.address_list span").each(function() {
			$("#consult").val($("#consult").val() + $(this).attr("data") + '|');
		})

		$("#consult_name").val("");
		$("#consult_name").val($("#consult_wrap span.address_list").html());

		$("#refer").val("");
		$("#refer_wrap span.address_list span").each(function() {
			$("#refer").val($("#refer").val() + $(this).attr("data") + '|');
		})

		$("#refer_name").val("");
		$("#refer_name").val($("#refer_wrap span.address_list").html());

		editor.sync();
		if (check_form("form_data")) {
			sendForm("form_data", "{:U('save')}", "{:U('edit?id='.$vo['id'])}");
		}
	}

	function popup_flow() {
		winopen("{:U('popup/flow')}", 730, 574);
	}


	$(document).ready(function() {
		set_val('group', '$vo.group');
		/* select 可以手动输入*/
		$("select.writeable").keypress(function(e) {
			if (this.options[0].text == "选择或录入") {
				this.options[0].text = '';
			}
			this.options[0].selected = "selected";
			this.options[0].text = this.options[0].text + String.fromCharCode(event.keyCode);
			this.options[0].value = this.options[0].text;
			e.returnValue = false;
		});
		/* select 可以手动输入*/
		$("select.writeable").keydown(function(e) {
			if (e.keyCode == 46) {
				this.options[0].text = '';
			}
		});
	}); 
</script>
